Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix focus on hidden widget in Either #1860

Merged
merged 5 commits into from
Jul 9, 2021

Conversation

lisael
Copy link
Contributor

@lisael lisael commented Jul 7, 2021

closes #1858

@xarvic
Copy link
Collaborator

xarvic commented Jul 7, 2021

Thanks!
Tabs has the same problem, adding a call to children_changed() in TabsBody should probably fix that. Could you add that too?

@lisael
Copy link
Contributor Author

lisael commented Jul 7, 2021

Yeah, I was thinking about checking all children-hiding widgets, Tabs was on the top of my list.
I add those in the PR.

@xarvic
Copy link
Collaborator

xarvic commented Jul 7, 2021

Tabs, Viewswitcher and Either are the only one i can think of and Viewswitcher already does it.

@lisael
Copy link
Contributor Author

lisael commented Jul 7, 2021

I did the change on Tab. I also removed a couple of ctx.request_layout() calls as children_changed() calls it too.

Bruno Dupuis and others added 3 commits July 8, 2021 09:48
I couldn't reproduce the bug in the example as the tab bar steals the focus anyway when we click on a tab

Whatever, it's still cleaner.

I also removed spurious ctx.request_layout calls, as it's already called in ctx.children_changed
Copy link
Collaborator

@xarvic xarvic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you!

@xarvic xarvic merged commit f35bec8 into linebender:master Jul 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should hidden widget keep the focus ?
2 participants